package com.neusoft.neu24.nep.nepadmin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.neusoft.neu24.nep.nepadmin.entity.Admins;
import com.neusoft.neu24.nep.nepadmin.mapper.AdminsMapper;
import com.neusoft.neu24.nep.nepadmin.service.IAdminsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统管理员表 服务实现类
 * </p>
 *
 * @author 段静迪，duanjingdi@163.com
 * @since 2024-06-19
 */
@Service
public class AdminsServiceImpl extends ServiceImpl<AdminsMapper, Admins> implements IAdminsService {
    @Cacheable(value = "nep-xxxx-admins" ,key = "'xyz'+ #adminId"  )
    @Override
    public Admins getAdminByName(Integer adminId) {
        LambdaQueryWrapper<Admins> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq( Admins::getAdminId ,adminId );
        Admins admins = baseMapper.selectOne( wrapper);
        return admins;
    }
}
